package bandwidthcontroller;

/**
 *
 * @author ppdbuilder
 */
public class BandwidthController {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) throws InterruptedException {

        BandwidthSettings bw = new BandwidthSettings();
        bw.setBandwidth("1000");
        bw.setIface("wlan0");
        bw.setTool("DummyNet");
        bw.setDelay("0");
        bw.setDst_ip("0.0.0.0");
        bw.setSrc_ip("0.0.0.0");
        bw.setPacket_loss("0");
        bw.setEnabled("true");
    
        TCOperations operator = new TCOperations("DummyNet");
        if(operator.isIngressDefined()){
            System.out.println("INGRESSED");
            operator.clearAllBandwidth(bw);
        }
        operator.setBandWidthAllIP(bw);
        
        BandwidthMonitor bmonitor = new BandwidthMonitor( bw.getIface());
        Thread t = new Thread(bmonitor);
        t.start();
        
        Thread.sleep(2000);
        int count = 3;
        while(count > 0){
            
            System.out.println(bmonitor.getCurrentBandwidth());
            Thread.sleep(3000);
        }
        
        
        
    }
}